package com.financing.platform.dao.impl;


import java.sql.SQLException;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.financing.platform.dao.ISalesPrizesDao;
import com.financing.platform.dto.SalesPrizesDTO;
import com.financing.platform.util.SqlName;
/**
 * sales_prizes  
 * 奖项配置表 数据访问层实现类
 * @author huqiyun
 *
 */
 
@Repository("salesPrizesDao")
public class SalesPrizesDaoImpl extends BaseDaoImpl implements ISalesPrizesDao {


	@Override
	public int insert(SalesPrizesDTO salesPrizes) throws SQLException {
		return (Integer) this.sqlMapClient.insert(SqlName.SalesPrizesSql.insert, salesPrizes);
	}

	@Override
	public void update(SalesPrizesDTO salesPrizes) throws SQLException {
		this.sqlMapClient.update(SqlName.SalesPrizesSql.update, salesPrizes);
	}

	@Override
	public void updateForce(SalesPrizesDTO salesPrizes) throws SQLException {
		this.sqlMapClient.update(SqlName.SalesPrizesSql.updateForce, salesPrizes);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		this.sqlMapClient.delete(SqlName.SalesPrizesSql.delete,id);
	}
	
	@SuppressWarnings("unchecked")	
	@Override
	public List<SalesPrizesDTO> queryList(SalesPrizesDTO salesPrizes) throws SQLException {
		return this.sqlMapClient.queryForList(SqlName.SalesPrizesSql.queryList, salesPrizes);
	}

	@Override
	public int queryListCount(SalesPrizesDTO salesPrizes) throws SQLException {
		return (Integer) this.sqlMapClient.queryForObject(SqlName.SalesPrizesSql.queryListCount, salesPrizes);
	}

	@Override
	public SalesPrizesDTO loadById(Integer id) throws SQLException {
		return  (SalesPrizesDTO)this.sqlMapClient.queryForObject(SqlName.SalesPrizesSql.loadById,id);
	}

}
